package org.openkoala.organisation.facade.dto;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

public class PostDTO implements Serializable {

    private static final long serialVersionUID = 1282817894639039057L;

    private Long id;

    private String name;

    private String sn;

    private String organizationName;

    private String jobName;

    private String description;

    private boolean organizationPrincipal;

    private int version;

    private Date createDate;

    private Date terminateDate;

    private Long employeeCount;

    private Long organizationId;

    private Long jobId;

    public PostDTO() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean isOrganizationPrincipal() {
        return organizationPrincipal;
    }

    public void setOrganizationPrincipal(boolean organizationPrincipal) {
        this.organizationPrincipal = organizationPrincipal;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getTerminateDate() {
        return terminateDate;
    }

    public void setTerminateDate(Date terminateDate) {
        this.terminateDate = terminateDate;
    }

    public Long getEmployeeCount() {
        return employeeCount;
    }

    public void setEmployeeCount(Long employeeCount) {
        this.employeeCount = employeeCount;
    }

    public Long getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(Long organizationId) {
        this.organizationId = organizationId;
    }

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    @Override
    public boolean equals(Object other) {
        if (!(other instanceof PostDTO)) {
            return false;
        }
        PostDTO that = (PostDTO) other;
        return new EqualsBuilder().append(this.getSn(), that.getSn())
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(getSn()).toHashCode();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this).append(getName()).build();
    }

}
